/**
 * 
 */
package ar.edu.unicen.exa.oop.bbquery.model.forum;

import java.net.URI;
import java.net.URISyntaxException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author nicolas
 * 
 */
public class PhpBBForumAuthTokenFactory {
	private static Logger log = LoggerFactory
			.getLogger(PhpBBForumAuthTokenFactory.class);

	public static ForumAuthToken getPhpBBForumAuthTokenFactory(String host, String User,
			String pwd, String pathToIndex, Integer Forum)
			throws URISyntaxException {
		BeanForumAuthToken f = ModelFactory.createBeanForumAuthToken(User, pwd, null, "phpbb");
		f.setForumRootURL(new URI("http", User, host, 80, pathToIndex
				.concat("/feed.php"), "f=".concat(Forum.toString()), ""));
		log.info("URI for PhpBB Forum : {}", f.getForumRootURL().toString());
		return f;
	}

	public static ForumAuthToken getPhpBBForumAuthTokenFactory(String host, String User, String pwd,
			String pathToIndex) throws URISyntaxException {
		BeanForumAuthToken f = ModelFactory.createBeanForumAuthToken(User, pwd, null, "phpbb");
		f.setForumRootURL(new URI("http",User, host, 80,
				pathToIndex.concat("/feed.php"), "", ""));
		log.info("URI for PhpBB Forum : {}", f.getForumRootURL().toString());
		return f;

	}

}
